<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="com.msmall.base.util.ConstantDB" language="java"%>

<%@ page import="com.msmall.community.space.util.SpaceConstants" language="java"%>
<c:set var="UNVISIBLE" value="<%=ConstantDB.UNVISIBLE%>"></c:set>
<c:set var="VISIBLE" value="<%=ConstantDB.VISIBLE%>"></c:set>
<c:set var="UNLOCK_STATUS" value="<%=ConstantDB.UNLOCK_STATUS%>"></c:set>
<c:set var="LOCK_STATUS" value="<%=ConstantDB.LOCK_STATUS%>"></c:set>
<c:set var="SPACE_WIDGET_PART_ALBUM" value="<%=SpaceConstants.SPACE_WIDGET_PART_ALBUM%>"></c:set>

<tiles:insertDefinition name="html.space.index.left.owner">
	<tiles:putAttribute name="userInfo" value="${userInfo}"></tiles:putAttribute>
</tiles:insertDefinition>
<div id="indexRightContent" class="spaw730">
	<div class="spaw730nav" style="margin:5px;height:200px;">
		<div style="height: 30px; padding: 6px 10px 0;width:500px;">
			<p class="fl" style="font-size: 14px;font-weight: bold;">随便说说</p>
			<p class="fr"></p>
		</div>
		<p class="margin:5px;">
			<textarea id="user_mood" name="user_mood" rows="30" cols="20" style="float:left;width:650px;height:100px;"></textarea>
		</p>
		<div style="height: 25px;padding: 5px 10px 0;width: 650px;">
			<p id="write_mood_result" style="float:left;width:500px;margin-right:12px;margin-left:100px;display:none;">
			</p>
			<p class="fr">
				<button class="but46" onclick="javascript:writeUserMood();" style="float:left;">发布</button>
			</p>
		</div>
	</div>
	<div id="space_index_mood" class="spalisdiv">
		<jsp:include page="/WEB-INF/content/html/mood/mood_list.jsp"></jsp:include>
	</div>
</div>
<script>
function writeUserMood(){
	$.ajax({
		type : "POST",
		url : '<c:url value="/mood/save.do"/>',
		data : "mood="+$("#user_mood").val(),
		dataType:"xml", 
		timeout:20000,
		success : function(data){
			if($(data).find('result').text().toUpperCase().indexOf("TRUE") >= 0){
				$("#write_mood_result").css("display", "block");
				$("#write_mood_result").html("发布成功");
				$("#user_mood").val("");
			}else{
				$("#write_mood_result").css("display", "none");
				$("#write_mood_result").html("发布失败");
			}
			setTimeout(function(){
				$("#write_mood_result").css("display", "none");
				$("#write_mood_result").html("");
			},3000);
		},
		error: function(){
		}
	});
}
</script>